package models

import "gorm.io/gorm"

type Orders struct {
	gorm.Model
	Orders    string  `gorm:"type:varchar(10)" json:"orders"`
	Types     string  `gorm:"type:varchar(5)" json:"types"`
	Status    string  `gorm:"type:varchar(10)" json:"status"`
	Ordertime string  `gorm:"type:varchar(15)" json:"ordertime"`
	Nums      int     `gorm:"type:int" json:"nums"`
	Price     float64 `gorm:"type:decimal(10,2)" json:"price"`
	User      string  `gorm:"type:varchar(5)" json:"user"`
}

func (o Orders) GetList() (ord []*Orders, err error) {
	err = DB.Find(&ord).Error
	return ord, err
}
